package com.yyl.rbacs.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.yyl.rbacs.sys.entity.SysMenu;
import lombok.Data;
import org.springframework.beans.BeanUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @BelongsProject: rbacs
 * @BelongsPackage: com.yyl.rbacs.vo
 * @Author: YuanSir
 * @CreateTime: 2022-10-28  16:46
 * @Description:
 * @Version: 1.0
 */

@Data
public class SysMenuListVo {
    
    @TableId(value = "menu_id", type = IdType.AUTO)
    private Long menuId;
    
    /**
     * 父菜单ID，一级菜单为0
     */
    private Long parentId;
    
    /**
     * 菜单名称
     */
    private String name;
    
    /**
     * 菜单URL
     */
    private String url;
    
    /**
     * 授权(多个用逗号分隔，如：user:list,user:create)
     */
    private String perms;
    
    /**
     * 类型   0：目录   1：菜单   2：按钮
     */
    private Integer type;
    
    /**
     * 菜单图标
     */
    private String icon;
    
    /**
     * 排序
     */
    private Integer orderNum;
    
    
    private List<SysMenuListVo> list = new ArrayList<>();
    
    
    public void setVoList(SysMenu sysMenu){
    
        SysMenuListVo sysMenuListVo = new SysMenuListVo();
    
        BeanUtils.copyProperties(sysMenu, sysMenuListVo);
        
        this.list.add(sysMenuListVo);
    
    }
    
}
